package com.bw.a2207a.cuview

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.EditText
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.bw.a2207a.R
import com.bw.a2207a.bean.SearchHistoryBean
import com.bw.a2207a.db.CartDbUtil

/**
 *
 * @ClassName: MySearchView
 * @Description: 组合view
 * @Author: zhangyanchao
 * @CreateDate: 2024/10/24 4:17 PM
 * @Version: 1.0
 */
class MySearchView : LinearLayout {

    lateinit var etSearch: EditText
    lateinit var textView: TextView

    //构造函数 constructor
    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
        LayoutInflater.from(context).inflate(R.layout.search_view_layout, this)
        initView()
    }

    private fun initView() {
        textView = findViewById<TextView>(R.id.tv_search)
        etSearch = findViewById<EditText>(R.id.et_search)

//        textView.setOnClickListener {
//            CartDbUtil.cartDb.getSearchDao()
//                .insertSearch(SearchHistoryBean(null, etSearch.text.toString()))
//
//        }
    }


}